﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="True" CodeBehind="EditApplicationPage.aspx.cs" Inherits="Cms.Web.UI.Admin.EditApplicationPage" ValidateRequest="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="Admin/js/jquery-ui-1.8.15.custom.min.js"></script>    
    <script type="text/javascript" src="Admin/js/jquery-timepicker-addon.js"></script>    
    <script language="javascript" type="text/javascript" src="Admin/edit_area/edit_area_loader.js"></script>
    <script language="javascript" type="text/javascript" src="Admin/Js/Edit.js"></script>
    <script language="javascript" type="text/javascript" src="Admin/Js/cms.date.js"></script>
    <script language="javascript" type="text/javascript">
        //<![CDATA[
        $(document).ready(function () {
            cms.Edit.ShowTabOverlays();
        });

        var codeEditorLoaded = false;
        var designEditorLoaded = false;

        function editorLoaded(id) {
            if (id == "txtCode")
                codeEditorLoaded = true;
            if (id == "txtDesign")
                designEditorLoaded = true;
            if (codeEditorLoaded && designEditorLoaded) {
                editAreaLoader.setValue("txtDesign", originalDesign);
                editAreaLoader.setValue("txtCode", originalCode);
                cms.Edit.HideTabOverlays();
            }
            if (document.getElementById("ctl00_body_pnlBasicProperties").style.display == "")
                document.getElementById("ctl00_body_txtName").focus();
            if (document.getElementById("ctl00_body_pnlLocalizedProperties").style.display == "")
                document.getElementById("ctl00_body_txtTitle").focus();
            if (document.getElementById("ctl00_body_pnlDesign").offsetLeft >= 0) {
                editAreaLoader.toggle("txtDesign");
                editAreaLoader.toggle("txtDesign");
            }
            if (document.getElementById("ctl00_body_pnlCode").offsetLeft >= 0) {
                editAreaLoader.toggle("txtCode");
                editAreaLoader.toggle("txtCode");
            }
        }

        editAreaLoader.init({
            id: "txtDesign",
            syntax: "html",
            start_highlight: true,
            allow_resize: "no",
            allow_toggle: false,
            toolbar: "undo,redo,change_smooth_selection,reset_highlight,highlight,syntax_selection",
            word_wrap: true,
            replace_tab_by_spaces: 4,
            EA_load_callback: "editorLoaded"
        });

        editAreaLoader.init({
            id: "txtCode",
            syntax: "cpp",
            start_highlight: true,
            allow_resize: "no",
            allow_toggle: false,
            toolbar: "undo,redo,change_smooth_selection,reset_highlight,highlight,syntax_selection",
            word_wrap: true,
            replace_tab_by_spaces: 4,
            EA_load_callback: "editorLoaded"
        });

        function updateCode() {
            txtDesign = document.getElementById("txtDesign");
            txtCode = document.getElementById("txtCode");
            //alert("Design before:\n" + txtDesign.value + "\n\n\nCode before:\n" + txtCode.value);
            txtDesign.value = editAreaLoader.getValue("txtDesign");
            document.getElementById("ctl00_body_hidDesign").value = txtDesign.value;
            txtCode.value = editAreaLoader.getValue("txtCode");
            document.getElementById("ctl00_body_hidCode").value = txtCode.value;
        }

        function setCodeEditorHeight() {
            var viewportHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
            var designContainer = document.getElementById("designContainer");
            var codeContainer = document.getElementById("codeContainer");
            var designHeight = viewportHeight - iLib.Pos.FindY(designContainer) - 65;
            designHeight = designHeight < 100 ? 100 : designHeight;
            designContainer.style.height = designHeight + "px";
            var codeHeight = viewportHeight - iLib.Pos.FindY(codeContainer) - 65;
            codeHeight = codeHeight < 100 ? 100 : codeHeight;
            codeContainer.style.height = codeHeight + "px";
        }

        function updatePanels(tab) {
            var pnlBasicProperties = document.getElementById("ctl00_body_pnlBasicProperties");
            var pnlLocalizedProperties = document.getElementById("ctl00_body_pnlLocalizedProperties");
            var pnlDesign = document.getElementById("ctl00_body_pnlDesign");
            var pnlCode = document.getElementById("ctl00_body_pnlCode");
            var pnlContent = document.getElementById("ctl00_body_pnlContent");
            pnlBasicProperties.style.display = "none";
            pnlLocalizedProperties.style.display = "none";
            var width = pnlDesign.offsetWidth;
            pnlDesign.style.position = "absolute";
            pnlDesign.style.left = -10000 + "px";
            pnlDesign.style.width = width + "px";
            pnlDesign.style.top = "0px";
            pnlCode.style.position = "absolute";
            pnlCode.style.left = -10000 + "px";
            pnlCode.style.width = width + "px";
            pnlCode.style.top = "0px";
            pnlContent.style.display = "none";
            switch (tab) {
                case "basicproperties":
                    pnlBasicProperties.style.display = "";
                    break;
                case "localizedproperties":
                    pnlLocalizedProperties.style.display = "";
                    break;
                case "design":
                    pnlDesign.style.position = "";
                    pnlDesign.style.width = "100%";
                    pnlDesign.style.left = "0px";
                    break;
                case "code":
                    pnlCode.style.position = "";
                    pnlCode.style.width = "100%";
                    pnlCode.style.left = "0px";
                    break;
                case "content":
                    pnlContent.style.display = "";
                    break;
            }
        }

        var txtFilename;
	    var txtName;
	    var ddlFolders;
	    var ddlMasterTemplates;
	    var ddlDetailTemplates;
	    var txtTitle;
	    var txtDescription;
	    var txtKeywords;
	    var txtListingsTitle;
	    var txtListingsDescription;
	    var txtDesign;
	    var txtCode;
	    var txtSortKey;
	    var txtHeadHtml;
	    var txtBodyTopHtml;
	    var txtBodyBottomHtml;
	    var txtStartPublishing;
	    var txtEndPublishing;

	    var originalFilename;
	    var originalName;
	    var originalFolderID;
	    var originalMasterTemplateID;
	    var originalDetailTemplateID;
	    var originalTitle;
	    var originalDescription;
	    var originalKeywords;
	    var originalListingsTitle;
	    var originalListingsDescription;
	    var originalDesign;
	    var originalCode;
	    var originalSortKey;
	    var originalHeadHtml;
	    var originalBodyTopHtml;
	    var originalBodyBottomHtml;
	    var originalSelectedCategories;
	    var originalSelectedAllowedAdminGroups;
	    var originalSelectedDeniedAdminGroups;
	    var originalSelectedRequiredUserGroups;
	    var originalStartPublishing;
	    var originalEndPublishing;

	    function init() {
	        setCodeEditorHeight();
	        txtFilename = document.getElementById("ctl00_body_txtFilename");
	        txtName = document.getElementById("ctl00_body_txtName");
	        ddlFolders = document.getElementById("ctl00_body_ddlFolders");
	        ddlMasterTemplates = document.getElementById("ctl00_body_ddlMasterTemplates");
	        ddlDetailTemplates = document.getElementById("ctl00_body_ddlDetailTemplates");
	        txtTitle = document.getElementById("ctl00_body_txtTitle");
	        txtDescription = document.getElementById("ctl00_body_txtDescription");
	        txtKeywords = document.getElementById("ctl00_body_txtKeywords");
	        txtListingsTitle = document.getElementById("ctl00_body_txtListingsTitle");
	        txtListingsDescription = document.getElementById("ctl00_body_txtListingsDescription");
	        txtDesign = document.getElementById("txtDesign");
	        txtCode = document.getElementById("txtCode");
	        txtSortKey = document.getElementById("ctl00_body_txtSortKey");
	        txtHeadHtml = document.getElementById("ctl00_body_txtHeadHtml");
	        txtBodyTopHtml = document.getElementById("ctl00_body_txtBodyTopHtml");
	        txtBodyBottomHtml = document.getElementById("ctl00_body_txtBodyBottomHtml");
	        txtStartPublishing = document.getElementById("ctl00_body_txtStartPublishing");
	        txtEndPublishing = document.getElementById("ctl00_body_txtEndPublishing");
	        setupDatePicker(txtStartPublishing);
	        setupDatePicker(txtEndPublishing);
	        originalFilename = txtFilename.value;
	        originalName = txtName.value;
	        originalFolderID = ddlFolders.options[ddlFolders.selectedIndex].value;
	        originalMasterTemplateID = ddlMasterTemplates.options[ddlMasterTemplates.selectedIndex].value;
	        originalDetailTemplateID = ddlDetailTemplates.options[ddlDetailTemplates.selectedIndex].value;
	        originalTitle = txtTitle.value;
	        originalDescription = txtDescription.value;
	        originalKeywords = txtKeywords.value;
	        originalListingsTitle = txtListingsTitle.value;
	        originalListingsDescription = txtListingsDescription.value;
	        originalDesign = document.getElementById("ctl00_body_hidDesign").value;
	        originalCode = document.getElementById("ctl00_body_hidCode").value;
	        originalSortKey = txtSortKey.value;
	        originalHeadHtml = txtHeadHtml.value;
	        originalBodyTopHtml = txtBodyTopHtml.value;
	        originalBodyBottomHtml = txtBodyBottomHtml.value;
	        originalStartPublishing = txtStartPublishing.value;
	        originalEndPublishing = txtEndPublishing.value;
	        editAreaLoader.setValue("txtDesign", originalDesign);
	        editAreaLoader.setValue("txtCode", originalCode);
	        originalSelectedCategories = cms.Edit.GetSelectedCheckboxValues("ctl00_body_tdCategories");
	        originalSelectedAllowedAdminGroups = cms.Edit.GetSelectedCheckboxValues("ctl00_body_tdAllowedAdminGroups");
	        originalSelectedDeniedAdminGroups = cms.Edit.GetSelectedCheckboxValues("ctl00_body_tdDeniedAdminGroups");
	        originalSelectedRequiredUserGroups = cms.Edit.GetSelectedCheckboxValues("ctl00_body_tdRequiredUserGroups");
	    }

	    function isDirty() {
	        txtListingsTitle = document.getElementById("ctl00_body_txtListingsTitle");
	        txtListingsDescription = document.getElementById("ctl00_body_txtListingsDescription");
	        ddlFolders = document.getElementById("ctl00_body_ddlFolders");
	        ddlMasterTemplates = document.getElementById("ctl00_body_ddlMasterTemplates");
	        ddlDetailTemplates = document.getElementById("ctl00_body_ddlDetailTemplates");
	        var value = originalFilename == "" || originalName == "" ||
	                    originalFilename != txtFilename.value ||
	                    originalName != txtName.value ||
	                    originalFolderID != ddlFolders.options[ddlFolders.selectedIndex].value ||
	                    originalMasterTemplateID != ddlMasterTemplates.options[ddlMasterTemplates.selectedIndex].value ||
	                    originalDetailTemplateID != ddlDetailTemplates.options[ddlDetailTemplates.selectedIndex].value ||
            	        originalDesign != txtDesign.value ||
	                    originalCode != txtCode.value ||
	                    originalTitle != txtTitle.value ||
	                    originalDescription != txtDescription.value ||
	                    originalKeywords != txtKeywords.value ||
	                    originalListingsTitle != txtListingsTitle.value ||
	                    originalListingsDescription != txtListingsDescription.value ||
	                    originalSortKey != txtSortKey.value ||
	                    originalHeadHtml != txtHeadHtml.value ||
	                    originalBodyTopHtml != txtBodyTopHtml.value ||
	                    originalBodyBottomHtml != txtBodyBottomHtml.value ||
	                    originalStartPublishing != txtStartPublishing.value ||
	                    originalEndPublishing != txtEndPublishing.value ||
	                    originalSelectedCategories != cms.Edit.GetSelectedCheckboxValues("ctl00_body_tdCategories") ||
	                    originalSelectedAllowedAdminGroups != cms.Edit.GetSelectedCheckboxValues("ctl00_body_tdAllowedAdminGroups") ||
	                    originalSelectedDeniedAdminGroups != cms.Edit.GetSelectedCheckboxValues("ctl00_body_tdDeniedAdminGroups") ||
	                    originalSelectedRequiredUserGroups != cms.Edit.GetSelectedCheckboxValues("ctl00_body_tdRequiredUserGroups");
	        document.getElementById("ctl00_tabs_hidIsDirty").value = value;
	        return value;
	    }

	    function breakContentLink(areaID, contentType) {
	        document.getElementById("ctl00_tabs_hidBreakLinkAreaID").value = areaID;
	        document.getElementById("ctl00_tabs_hidBreakLinkContentType").value = contentType;
	        document.getElementById("ctl00_tabs_btnTriggerBreakContentLinkConfirmation").click();
	    }

	    function breakContentLinkCallback(status) {
	        if (status != "ok")
	            return;
	        cms.Edit.ShowTabOverlays();
	        document.getElementById("ctl00_tabs_btnBreakContentLink").click();
	    }

	    function initDateTimePickers() {
	        txtStartPublishing = document.getElementById("ctl00_body_txtStartPublishing");
	        txtEndPublishing = document.getElementById("ctl00_body_txtEndPublishing");
	        setupDatePicker(txtStartPublishing);
	        setupDatePicker(txtEndPublishing);
	    }

	    function initInlineDateTimePicker() {
	        var div = document.getElementById("datetimepicker");
	        var hid = document.getElementById("ctl00_body_hidScheduledPublishing");
	        setupInlineDatePicker(div, hid);
	        $(div).datetimepicker('setDate', (new Date()));
	    }

	    function schedulePublishingCallback(status) {
	        var hid = document.getElementById("ctl00_body_hidScheduledPublishing");
	        if (status != 'ok')
	            return;
	        cms.Edit.ShowTabOverlays();
	        document.getElementById("ctl00_body_btnSchedulePublishing").click();
	    }
	    //]]>
	</script>
    <link type="text/css" href="Admin/css/jquery-ui-1.8.16.custom.css" rel="Stylesheet" />	
    <link type="text/css" href="Admin/css/DateTimePicker.css" rel="Stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="buttons" runat="server">
    <asp:UpdatePanel ID="upnlButtons" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
        <ContentTemplate>
            <asp:hyperlink ID="hlView" runat="server" navigateUrl="Admin/Explorer.aspx" CssClass="orangeButton"><span id="lblView1" runat="server"><span id="lblView2" runat="server"><img id="imgView" runat="server" src="Admin/Img/icons/page_magnify.png" alt="" /><span id="lblView3" runat="server"><cms:LocalizedLiteral ID="llViewPage" runat="server" /></span></span></span></asp:hyperlink>
            <asp:LinkButton ID="lbSavePage" runat="server" OnClick="lbSavePage_Click" CssClass="orangeButton" OnClientClick="isDirty(); updateCode();"><span id="lblSave1" runat="server"><span id="lblSave2" runat="server"><img id="imgSave" runat="server" src="Admin/Img/icons/disk.png" alt="" /><span id="lblSave3" runat="server"><cms:LocalizedLiteral ID="llSavePage" runat="server" /></span></span></span></asp:LinkButton>
            <asp:hyperlink ID="hlCancel" runat="server" navigateUrl="Admin/Explorer.aspx" CssClass="orangeButton"><span id="lblCancel1" runat="server"><span id="lblCancel2" runat="server"><img id="imgCancel" runat="server" src="Admin/Img/icons/delete.png" alt="" /><span id="lblCancel3" runat="server"><cms:LocalizedLiteral ID="llCancel" runat="server" /></span></span></span></asp:hyperlink>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="tabs" runat="server">
    <asp:UpdatePanel ID="upnlTabs" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
        <ContentTemplate>
            <cms:AdminTabStrip ID="tabStrip" runat="server" SelectedValue="basicproperties" OnChange="tabStrip_Click">
                <cms:AdminTabItem ID="tiBasicProperties" runat="server" value="basicproperties" EnabledImage="Admin/Img/icons/page_gear.png"><cms:LocalizedLiteral ID="llBasicPropertiesTab" runat="server" /></cms:AdminTabItem>
                <cms:AdminTabItem ID="tiLocalizedProperties" runat="server" value="localizedproperties" EnabledImage="Admin/Img/icons/page_world.png"><cms:LocalizedLiteral ID="llLocalizedPropertiesTab" runat="server" /></cms:AdminTabItem>
                <cms:AdminTabItem ID="tiDesign" runat="server" value="design" EnabledImage="Admin/Img/icons/page_code.png"><cms:LocalizedLiteral ID="llDesignTab" runat="server" /></cms:AdminTabItem>
                <cms:AdminTabItem ID="tiCode" runat="server" value="code" EnabledImage="Admin/Img/icons/page_white_csharp.png"><cms:LocalizedLiteral ID="llCodeTab" runat="server" /></cms:AdminTabItem>
                <cms:AdminTabItem ID="tiContent" runat="server" value="content" EnabledImage="Admin/Img/icons/page_white_edit.png"><cms:LocalizedLiteral ID="llContentTab" runat="server" /></cms:AdminTabItem>
            </cms:AdminTabStrip>
            <input type="hidden" id="hidIsDirty" runat="server" />
            <input type="hidden" id="hidSave" runat="server" />
            <input type="hidden" id="hidPageID" runat="server" />
            <input type="hidden" id="hidBreakLinkAreaID" runat="server" />
            <input type="hidden" id="hidBreakLinkContentType" runat="server" />
            <div style="position: absolute; top: 0px; left: -10000px;">
                <asp:Button ID="btnTriggerBreakContentLinkConfirmation" runat="server" OnClick="btnTriggerBreakContentLinkConfirmation_Click" Text="Break content link confirmation trigger" />
                <asp:Button ID="btnBreakContentLink" runat="server" OnClick="btnBreakContentLink_Click" Text="Break content link" />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="body" runat="server">
    <asp:Literal ID="litIcon" runat="server" Visible="false" Text="Admin/Img/Icons/page_edit.png" />

    <asp:Panel ID="pnlDesign" runat="server" CssClass="pnlTab">
        <asp:UpdatePanel ID="upnlDesign" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
            <ContentTemplate>
                <asp:DropDownList ID="ddlAreas" runat="server" OnSelectedIndexChanged="ddlAreas_IndexChanged" AutoPostBack="false" />
                <input type="hidden" id="hidDesign" runat="server" />
                <input type="hidden" id="hidSaveDesign" runat="server" />
            </ContentTemplate>
        </asp:UpdatePanel>
        <div id="designContainer" style="height: 400px;">
            <textarea id="txtDesign" cols="10" rows="10" style="width: 100%; height: 100%;"></textarea>
        </div>
        <div class="pnlTabOverlay"></div>
    </asp:Panel>
    
    <asp:Panel ID="pnlCode" runat="server" CssClass="pnlTab">
        <asp:UpdatePanel ID="upnlCode" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
            <ContentTemplate>
                <input type="hidden" id="hidCode" runat="server" />
                <input type="hidden" id="hidSaveCode" runat="server" />
            </ContentTemplate>
        </asp:UpdatePanel>
        <div id="codeContainer" style="height: 400px;">
            <textarea id="txtCode" cols="10" rows="10" style="width: 100%; height: 100%;"></textarea>
        </div>
        <div class="pnlTabOverlay"></div>
    </asp:Panel>
    
    <asp:Panel ID="pnlBasicProperties" runat="server" CssClass="pnlTab">
        <asp:UpdatePanel ID="upnlBasicProperties" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
            <ContentTemplate>
                <table class="editForm">
                    <tr>
                        <td><cms:LocalizedLiteral ID="llName" runat="server" />:</td>
                        <td><asp:TextBox ID="txtName" runat="server" /></td>
                        <td><cms:LocalizedLiteral ID="llFilename" runat="server" />:</td>
                        <td>
                            <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td style="padding-right: 4px;"><asp:TextBox ID="txtFilename" runat="server" /></td>
                                    <td><strong>.aspx</strong></td>
                                </tr>
                            </table>
                        </td>
                        <td><cms:LocalizedLiteral ID="llFolder" runat="server" />:</td>
                        <td><ilib:iDropDownList ID="ddlFolders" runat="server" OnSelectedIndexChanged="ddlFolders_IndexChanged" AutoPostBack="true" /></td>
                    </tr>
                </table>
                <div class="adminPageSectionDivider"></div>
                <table class="editForm">
                    <tr>
                        <td><cms:LocalizedLiteral ID="llMasterTemplate" runat="server" />:</td>
                        <td><asp:DropDownList ID="ddlMasterTemplates" runat="server" OnSelectedIndexChanged="ddlMasterTemplates_IndexChanged" AutoPostBack="true" /></td>
                        <td><cms:LocalizedLiteral ID="llDetailTemplate" runat="server" />:</td>
                        <td><asp:DropDownList ID="ddlDetailTemplates" runat="server" OnSelectedIndexChanged="ddlDetailTemplates_IndexChanged" AutoPostBack="true" /></td>
                        <td><cms:LocalizedLiteral ID="llStartPublishing" runat="server" />:</td>
                        <td><asp:TextBox ID="txtStartPublishing" runat="server" /></td>
                        <td><cms:LocalizedLiteral ID="llEndPublishing" runat="server" />:</td>
                        <td><asp:TextBox ID="txtEndPublishing" runat="server" /></td>
                    </tr>
                </table>
                <div class="sitePreviewContainer">
                    <div class="sitePreviewHeader"><cms:LocalizedLiteral ID="llPreviewHeader2" runat="server" /></div>
                    <iframe id="ifrBasicPropertiesPreview" runat="server" frameborder="0" class="sitePreview" scrolling="no" height="300"></iframe>
                </div>
                <div style="font-size:16px; margin-top: 20px; padding-left: 2px;"><cms:LocalizedLiteral id="llAdvancedSettingsHeader" runat="server" /></div>
                <span class="editFormSubheader"><cms:LocalizedLiteral ID="llCategoriesAndSortingHeader" runat="server" /></span>
                <table class="editForm">
                    <tr id="trCategories" runat="server" valign="top">
                        <td style="width: 250px;"><cms:LocalizedLiteral ID="llCategories" runat="server" />:</td>
                        <td id="tdCategories" style="padding-bottom: 8px;"><cms:CategorySelector id="csCategories" runat="server" ShowTabOverlay="true" /></td>
                    </tr>
                    <tr>
                        <td><cms:LocalizedLiteral ID="llSortKey" runat="server" />:</td>
                        <td><asp:TextBox ID="txtSortKey" runat="server" MaxLength="255" Width="400" /></td>
                    </tr>
                </table>
                <span class="editFormSubheader"><cms:LocalizedLiteral ID="llUserAccessControlHeader" runat="server" /></span>
                <table class="editForm">
                    <tr id="trRequiredUserGroups" runat="server" valign="top">
                        <td style="width: 250px;"><cms:LocalizedLiteral ID="llRequiredUserGroups" runat="server" />:</td>
                        <td id="tdRequiredUserGroups"><cms:UserGroupSelector id="gsRequiredUserGroups" runat="server" ShowTabOverlay="true" /></td>
                    </tr>
                </table>
                <span class="editFormSubheader"><cms:LocalizedLiteral ID="llAdministratorAccessControlHeader" runat="server" /></span>
                <table class="editForm">
                    <tr id="trAllowedAdministratorGroups" runat="server" valign="top">
                        <td style="width: 250px;"><cms:LocalizedLiteral ID="llAllowedAdministratorGroups" runat="server" />:</td>
                        <td id="tdAllowedAdminGroups"><cms:AdministratorGroupSelector id="gsAllowedAdministratorGroups" runat="server" ShowTabOverlay="true" /></td>
                    </tr>
                    <tr id="trDeniedAdministratorGroups" runat="server" valign="top">
                        <td><cms:LocalizedLiteral ID="llDeniedAdministratorGroups" runat="server" />:</td>
                        <td id="tdDeniedAdminGroups"><cms:AdministratorGroupSelector id="gsDeniedAdministratorGroups" runat="server" ShowTabOverlay="true" /></td>
                    </tr>
                </table>
                <span class="editFormSubheader"><cms:LocalizedLiteral ID="llCustomHtmlHeader" runat="server" /></span>
                <table class="editForm">
                    <tr>
                        <td><cms:LocalizedLiteral ID="llHeadHtml" runat="server" />:</td>
                        <td><asp:TextBox ID="txtHeadHtml" runat="server" TextMode="MultiLine" Rows="10" Width="700" /></td>
                    </tr>
                    <tr>
                        <td><cms:LocalizedLiteral ID="llBodyTopHtml" runat="server" />:</td>
                        <td><asp:TextBox ID="txtBodyTopHtml" runat="server" TextMode="MultiLine" Rows="10" Width="700" /></td>
                    </tr>
                    <tr>
                        <td><cms:LocalizedLiteral ID="llBodyBottomHtml" runat="server" />:</td>
                        <td><asp:TextBox ID="txtBodyBottomHtml" runat="server" TextMode="MultiLine" Rows="10" Width="700" /></td>
                    </tr>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
        <div class="pnlTabOverlay"></div>
    </asp:Panel>

    <asp:Panel ID="pnlLocalizedProperties" runat="server" CssClass="pnlTab">
        <asp:UpdatePanel ID="upnlLocalizedProperties" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
            <ContentTemplate>
                <table class="editForm">
                    <tr>
                        <td><cms:LocalizedLiteral ID="llLocale2" runat="server" />:</td>
                        <td><asp:DropDownList ID="ddlPropertiesLocales" runat="server" OnSelectedIndexChanged="ddlLocales_IndexChanged" AutoPostBack="true" /></td>
                    </tr>
                </table>
                <span class="editFormSubheader"><cms:LocalizedLiteral ID="llSeoDescriptionsHeader" runat="server" /></span>
                <table class="editForm">
                    <tr>
                        <td><cms:LocalizedLiteral ID="llTitle" runat="server" />:</td>
                        <td><asp:TextBox ID="txtTitle" runat="server" MaxLength="255" Width="600" /></td>
                    </tr>
                    <tr>
                        <td><cms:LocalizedLiteral ID="llDescription" runat="server" />:</td>
                        <td><asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine" Width="600" Rows="5" /></td>
                    </tr>
                    <tr>
                        <td><cms:LocalizedLiteral ID="llKeywords" runat="server" />:</td>
                        <td><asp:TextBox ID="txtKeywords" runat="server" TextMode="MultiLine" Width="600" Rows="5" /></td>
                    </tr>
                </table>
                <span class="editFormSubheader"><cms:LocalizedLiteral ID="llSiteListingsDescriptionsHeader" runat="server" /></span>
                <table class="editForm">
                    <tr>
                        <td><cms:LocalizedLiteral ID="llListingsTitle" runat="server" />:</td>
                        <td><asp:TextBox ID="txtListingsTitle" runat="server" MaxLength="255" Width="600" /></td>
                    </tr>
                    <tr>
                        <td><cms:LocalizedLiteral ID="llListingsDescription" runat="server" />:</td>
                        <td><asp:TextBox ID="txtListingsDescription" runat="server" TextMode="MultiLine" Width="600" Rows="5" /></td>
                    </tr>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
        <div class="pnlTabOverlay"></div>
    </asp:Panel>
    
    <asp:Panel ID="pnlContent" runat="server" CssClass="pnlTab">
        <asp:UpdatePanel ID="upnlContent" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
            <ContentTemplate>
                <table class="editForm">
                    <tr>
                        <td><cms:LocalizedLiteral ID="llLocale" runat="server" />:</td>
                        <td><asp:DropDownList ID="ddlContentLocales" runat="server" OnSelectedIndexChanged="ddlLocales_IndexChanged" AutoPostBack="true" /></td>
                        <td><cms:LocalizedLiteral ID="llVersion" runat="server" />:</td>
                        <td><asp:DropDownList ID="ddlVersions" runat="server" OnSelectedIndexChanged="ddlVersions_IndexChanged" AutoPostBack="true" /></td>
                        <td><asp:LinkButton ID="lbPublish" runat="server" OnClick="lbPublish_Click" CssClass="orangeButton"><span id="s1" runat="server"><span id="s2" runat="server"><img src="Admin/Img/icons/page_white_go.png" alt="" id="imgPublish" runat="server" /><span id="s3" runat="server"><cms:LocalizedLiteral ID="llPublish" runat="server" /></span></span></span></asp:LinkButton></td>
                        <td><a ID="hlPublishLater" runat="server" Class="orangeButton" href="javascript:void(0);"><span id="Span1" runat="server"><span id="Span2" runat="server"><img src="Admin/Img/icons/clock.png" alt="" id="img1" runat="server" /><span id="Span3" runat="server"><cms:LocalizedLiteral ID="llPublishLater" runat="server" /></span></span></span></a></td>
                        <td><asp:LinkButton ID="lbCopyFromDefaultLocale" runat="server" OnClick="lbCopyFromDefaultLocale_Click">lbCopyFromDefaultLocale</asp:LinkButton></td>
                    </tr>
                </table>
                <table class="editForm">
                    <tr>
                        <td><cms:LocalizedLiteral ID="llPublishedVersion" runat="server" />: <asp:LinkButton ID="lbSelectPublishedVersion" runat="server" OnClick="lbSelectPublishedVersion_Click" /><cms:LocalizedLiteral ID="llNoVersionPublished" runat="server" /></td>
                    </tr>
                </table>
                <asp:Panel ID="pnlScheduledPublishings" runat="server">
                    <span style="display: block; font-weight: bold; padding-left: 4px; padding-top: 6px; padding-bottom: 4px;">Schemalagda publiceringar</span>
                    <table>
                        <tr>
                            <td>Version</td>
                            <td>Tidpunkt</td>
                            <td>&nbsp;</td>
                        </tr>
                    <asp:Repeater ID="rpScheduledPublishings" runat="server" OnItemDataBound="rpScheduledPublishings_ItemDataBound">
                        <ItemTemplate>
                            <tr>
                                <td><asp:Literal ID="litVersion" runat="server" /></td>
                                <td><asp:Literal ID="litTimestamp" runat="server" /></td>
                                <td><asp:LinkButton ID="lbDeleteScheduledPublishing" runat="server" OnClick="lbDeleteScheduledPublishing_Click" OnClientClick="cms.Edit.ShowTabOverlays();"><cms:LocalizedLiteral ID="llDeleteScheduledPublishing" runat="server" /></asp:LinkButton></td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                    </table>
                </asp:Panel>
                <div class="sitePreviewContainer">
                    <div class="sitePreviewHeader"><cms:LocalizedLiteral ID="llPreviewHeader" runat="server" /></div>
                    <iframe id="ifrContentPreview" runat="server" frameborder="0" class="sitePreview" scrolling="no" height="300"></iframe>
                </div>
                <div id="schedulePublishing" style="position: absolute; top:80px; left: -10000px;">
                    <div style="margin-top: 10px;  margin-bottom: 10px;">
                        <div id="datetimepicker"></div>
                    </div>
                    <input id="hidScheduledPublishing" runat="server" type="hidden" />
                </div>
                <asp:Button ID="btnSchedulePublishing" runat="server" Text="SchedulePublishing" OnClick="btnSchedulePublishing_Click" style="position: absolute; top: 0px; left: -10000px;" />
            </ContentTemplate>
        </asp:UpdatePanel>
        <div class="pnlTabOverlay"></div>
    </asp:Panel>

    <script language="javascript">
        //<![CDATA[
        iLib.Dom.AddListener(window, "load", init);
        cms.Ajax.Init();
        cms.Ajax.AddEndRequestHandler(function () {
            editAreaLoader.setValue("txtDesign", document.getElementById("ctl00_body_hidDesign").value);
            editAreaLoader.setValue("txtCode", document.getElementById("ctl00_body_hidCode").value);
            cms.Edit.HideTabOverlays();
            if (document.getElementById("ctl00_body_pnlBasicProperties").style.display == "")
                document.getElementById("ctl00_body_txtName").focus();
            if (document.getElementById("ctl00_body_pnlLocalizedProperties").style.display == "")
                document.getElementById("ctl00_body_txtTitle").focus();
            if (document.getElementById("ctl00_body_pnlDesign").offsetLeft >= 0) {
                editAreaLoader.toggle("txtDesign");
                editAreaLoader.toggle("txtDesign");
            }
            if (document.getElementById("ctl00_body_pnlCode").offsetLeft >= 0) {
                editAreaLoader.toggle("txtCode");
                editAreaLoader.toggle("txtCode");
            }
        });
        cms.Ajax.AddEndRequestHandler(initDateTimePickers);
        //]]>
    </script>
</asp:Content>
